from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By

# 1、打开⾕歌浏览器(实例化浏览器对象)
driver = webdriver.Chrome("D:\\WorkSpace\\to_do\\Code\\exercise\\pythonProject\\app\\chromedriver.exe")
# 2、输⼊url
driver.get("file:///D:/WorkSpace/%E6%AD%A3%E5%9C%A8%E7%94%A8/%E9%BB%91%E9%A9%AC%E6%B5%8B%E8%AF%95/09%E7%AC%AC%E4%B9"
           "%9D%E9%98%B6%E6%AE%B5-UI%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95/%E6%B3%A8%E5%86%8CA.html")
# 3、找元素及操作
driver.find_element(By.ID, "userA").send_keys("admin")
driver.find_element(By.ID, "passwordA").send_keys("admin")
# 4、关闭浏览器
sleep(3)
driver.quit()
